package dataStructure;

import java.util.ArrayList;

import android.util.Log;

public class DataLayerObject extends DataObject{

	private String name;
	private String title;
	private boolean visible;
	private int level;
	private Double[] boundaryBox;//west, east, south, north
	
	
	
	//CONSTRUCTOR
	public DataLayerObject(String tagName, DataObject parent) {
		super(tagName, parent);
		
		this.name = "";
		this.title = "";
		this.visible = true;
		level = 0;
		boundaryBox = new Double[]{0.0 ,0.0, 0.0, 0.0};//west, east, south, north
		
		
	}
	
	//GETTERS
	public String getName()
	{
		return this.name;
	}
	
	public String getTitle()
	{
		return this.title;
	}
	
	public boolean isVisible()
	{
		return this.visible;
	}
	
	public int getLevel()
	{
		return this.level;
	}
	
	//boundaryBox
	public Double[] getBoundaryBox()
	{
		return this.boundaryBox;//west, east, south, north
	}
	public Double getWest()
	{
		return this.boundaryBox[0];
	}
	
	public Double getEast()
	{
		return this.boundaryBox[1];
	}
	
	public Double getSouth()
	{
		return this.boundaryBox[2];
	}
	
	public Double getNorth()
	{
		return this.boundaryBox[3];
	}
	//end boundaryBox
	
	
	//END GETTERS
		
	
	//SETTERS
	
	public void setName(String name)
	{
		this.name = name;
	}
	
	public void setTitle(String title)
	{
		this.title = title;
	}
	
	public void setVisible(boolean visible)
	{
		this.visible = visible;
	}
	
	public void setLevel(int level)
	{
		this.level = level;
	}
	
	//boundaryBox
	public void setBoundaryBox(Double[] boundaryBox)
	{
		this.boundaryBox = boundaryBox;//west, east, south, north
	}
	public void setWest(Double west)
	{
		this.boundaryBox[0] = west;
	}
	
	public void setEast(Double east)
	{
		this.boundaryBox[1] = east;
	}
	
	public void setSouth(Double south)
	{
		this.boundaryBox[2] = south;
	}
	
	public void setNorth(Double north)
	{
		this.boundaryBox[3] = north;
	}
	//end boundaryBox
	
	//END SETTERS
	
	//HELPERS
	
	 
	public void testProperties()
	{
		Log.i("TEST "+ this.getTagName() , "tagname = "+this.getTagName());
		Log.i("TEST "+ this.getTagName() , "type = "+this.getType());
		Log.i("TEST "+ name , "level = "+this.getLevel());
		Log.i("TEST "+ name , "name = "+name);
		Log.i("TEST "+ name , "title = "+title);
		Log.i("TEST "+ name , "vis = "+visible);
		Log.i("TEST "+ name , "level = "+level);
		Log.i("TEST "+ name , "childs = "+this.getChildren().size());
		Log.i("TEST wesn", "w e s n = " + getWest()+" "+getEast()+" "+ getSouth()+" "+getNorth());
	}
	
	public void testChildTagNames()
	{
		for(int i=0;i<this.getChildren().size();i++)
		{
			Log.i("chTags "+ this.name , i + "| lvl: "+((DataLayerObject)this.getChildren().get(i)).getLevel()+" | name: "+((DataLayerObject)this.getChildren().get(i)).getName()+" |title: "+((DataLayerObject)this.getChildren().get(i)).getTitle()+"| w e s n = " + ((DataLayerObject)this.getChildren().get(i)).getWest()+" "+((DataLayerObject)this.getChildren().get(i)).getEast()+" "+ ((DataLayerObject)this.getChildren().get(i)).getSouth()+" "+((DataLayerObject)this.getChildren().get(i)).getNorth());		
		} 
	}
	//END HELPERS

}
